package com.ftg.examsys.controller;

import com.ftg.examsys.entity.RoleEntity;
import com.ftg.examsys.service.RoleService;
import com.ftg.examsys.util.ResBuilder;
import com.ftg.examsys.util.ResUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 角色控制器
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/9/12 上午8:51
 */
@Api(tags = "角色管理")
@RestController
@RequestMapping("/role")
public class RoleController {

    @Resource
    RoleService roleService;

    @ApiOperation("列出全部角色")
    @GetMapping("/showall")
    public ResUtil<List<RoleEntity>> showall() {
        return ResBuilder.ok(roleService.showall());
    }

}
